<%@page import="cn.sbgs.www.common.Constant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html>
<style>
    .information .text {
        overflow: hidden;
        padding-bottom: 10px;
        border-bottom: dashed 1px #ccc;
    }

    .information .text span {
        display: block;
        line-height: 24px;
    }

    .information .text a {
        padding: 5px 10px;
    }

</style>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>青少年书法-学校列表</title>
    <link href="<%=request.getContextPath()%>/css/global.css" rel="stylesheet" type="text/css">
    <link href="<%=request.getContextPath()%>/css/contect.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/kkpager.css" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/kkpager.min.js"></script>
    <link href="<%=request.getContextPath()%>/bt/css/bootstrap.min.css" rel="stylesheet" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/bt/js/bootstrap.min.js"></script>
</head>

<body>
<!--头部开始-->
<div class="bannercon">
    <div class="banner">
        <img src="<%=request.getContextPath()%>/image/logo.png">
    </div>
</div>
<!--正文开始-->
<div class="maincon">
    <div class="main">
        <div class="navcon">
            <ul>
                <li>
                    <a href="/" >首页</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/client/news/getActivitylist.do" >活动</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/client/news/getHdlist.do" >互动</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/client/news/getSchoolList.do" >名校</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/client/news/mentorship.do" class="currentA">师友</a>
                </li>
                <li>
                    <a href="<%=request.getContextPath()%>/client/news/getMagazineList.do">杂志</a>
                </li>
            </ul>
        </div>
        <div class="section1">
            <h5><a href="/">首页</a>&gt;&gt;<a href="#">师友详情</a></h5>
            <div class="row">
                <div class="col-md-8">
                    <div class="media">
                        <div class="media-left">
                            <a href="#">
                                <img class="media-object img-thumbnail" src="<%=Constant.Url1158%>${data.user.userPhoto}" style="width: 80px;height: 80px">
                            </a>
                        </div>
                        <div class="media-body">
                            <h4 class="media-heading text-muted">${data.user.nikeName}</h4><a href="#">积分 <span class="label label-warning label-pill">${data.user.score}</span></a><br>
                            <div class="row">
                                <div class="col-md-4">
                                    <c:if test="${not empty data.user.schoolName}">
                                        <a href="<%=request.getContextPath()%>/client/news/getSchoolDetail.do?schoolId=${data.user.schoolId}"><span class="label label-primary">${data.user.schoolName}</span></a>
                                    </c:if>
                                </div>
                                <div class="col-md-8">
                                    <c:if test="${not empty data.user.teacherName}">
                                        <a href="<%=request.getContextPath()%>/client/news/getTeacherDetail.do?teacherId=${data.user.teacherId}"><span class="label label-primary">老师  ${data.user.teacherName}</span></a>
                                    </c:if>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class=" panel-info">
                        <div class="panel-body">
                            <span class="label label-danger" style="font-size: 20px">青少年书法荣誉</span>
                        </div>
                        <div class="panel-footer">
                            <div class="alert alert-info" role="alert">
                                <c:if test="${fn:length(data.user.honorsName) == 0}">
                                    暂无获取荣誉
                                </c:if>
                                <c:forEach items="${data.user.honorsName}" var="d" varStatus="status" begin="0" end="2">
                                    ${d}
                                    <c:if test="${status.count ==3}">
                                        ...
                                    </c:if>
                                    <br>
                                </c:forEach>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="contain clear">
                <c:if test="${fn:length(data.list)==0}"><div class="alert alert-danger" role="alert">暂无数据</div></c:if>
                <c:if test="${fn:length(data.list)>0}">
                <div class="list-group">
                <c:forEach items="${data.list}" var="dt" varStatus="status">
                    <div class="conright01 left">
                        <div class="information">
                            <div class="row">
                                <div class="col-md-2">

                                    <strong style="font-size: 30px;"> <fmt:formatDate value="${dt.createTime}" pattern="dd"/></strong>/ <fmt:formatDate value="${dt.createTime}" pattern="MM"/>月

                                </div>
                                <div class="col-md-10">
                                    <div class="row">
                                        <div class="col-md-12">
                                            ${dt.idesc}
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <c:if test="${fn:length(dt.picList)==0}"><div class="alert alert-danger" role="alert">暂无图片</div></c:if>
                                            <c:if test="${fn:length(dt.picList)>0}">
                                                <c:forEach items="${dt.picList}" var="p" varStatus="p_status">
                                                    <a onclick="javascripts:window.open('<%=Constant.Url1158%>${p.pic_b}')" href="#"><img src="<%=Constant.Url1158%>${p.pic_s}" class="img-thumbnail" style="width: 150px;height: 150px;">
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <span class="right"><a>赞（<i style="color: red">${ dt.goodCount}</i>）</a><a>评价（<i style="color: red">${ dt.commentCount}</i>）</a><a>收藏（<i style="color: red">${ dt.favoriteCount}</i>）</a></span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </c:forEach>
                </div>
                    <div id="kkpager"></div>
                </c:if>

            </div>

        </div>
    </div>
</div>
<!--主体结束-->
<!--footer-->
<div class="footercon">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12" style="background-color: #002a80;height: 250px">
                <div class="section1">
                    <div class="row" style="width: 1000px;margin: 0 auto;line-height: 40px;">
                        <div class="col-md-4">
                            <div class="row">
                                <div class="col-md-12">
                                    <strong style="font-size: 20px;color: white;font-family:  '新宋体'">更多精彩内容</strong>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div id="downloadImg"><img src="<%=Constant.Url1158%>${footer0.col2}"></div>
                                </div>
                                <div class="col-md-6">
                                    <div class="row" style="position: absolute;top: 12px">
                                        <div class="col-md-12">
                                            <input type="button" style="filter: alpha(opacity=45); opacity:0.45; width: 140px;height: 40px">
                                            <strong style="position:absolute;left: 25px;top: 2px;font-size: 17px;font-weight:bolder;color: white;font-family:  '新宋体'">Android版下载</strong>
                                        </div>
                                    </div>
                                    <div class="row" style="position: absolute;top: 80px">
                                        <div class="col-md-12" >
                                            <input type="button" style="filter: alpha(opacity=45); opacity:0.45; width: 140px;height: 40px">
                                            <strong style="position:absolute;left: 25px;top: 2px;font-size: 17px;font-weight:bolder;color: white;font-family:  '新宋体'">iPhone版下载</strong>
                                        </div>

                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <strong style="font-size: medium;color: white">扫描二维码,下载手机客户端</strong>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="row">
                                <div class="col-md-12">
                                    <strong style="font-size: 20px;color: white;font-family:  '新宋体'">微信公众号 ： </strong><strong style="font-size: 20px;color:orange;font-family:  '新宋体'">青少年书法</strong>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <div id="weixinImg"><img src="<%=Constant.Url1158%>${footer0.col3}"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="row">
                                <div class="col-md-12">
                                    <div id="tellus" style="position:absolute;top:20px;font-size: 15px;color:darkgray;line-height: 25px;font-family:  '新宋体'">
                                        ${footer1.content}
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <strong style="position: absolute;top: 180px;font-size: 10px;color:#2d6987;font-family:  '新宋体'">青少年书法&nbsp;版权所有2013-2013&nbsp;ICP备8888888号</strong>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    function getParameter(name) {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r!=null) return unescape(r[2]); return null;
    }

    //init
    $(function(){
        var totalPage =${PageBean.pagecount};
        var totalRecords = ${PageBean.recordscount};
        var pageNo = getParameter('p');
        if(!pageNo){
            pageNo = 1;
        }
        //初始化分页控件
        //有些参数是可选的，比如lang，若不传有默认值
        kkpager.init({
            pno : pageNo,
            //总页码
            total : totalPage,
            //总数据条数
            totalRecords : totalRecords,
            //链接前部
            hrefFormer : '<%=request.getContextPath()%>/client/news/mentorshipDetail.do',
            //链接尾部
            hrefLatter : '',
            getLink : function(n){
                return this.hrefFormer + this.hrefLatter + "?p="+n+"&id=${data.user.userId}";
            },
            lang : {
                prePageText : '上一页',
                nextPageText : '下一页',
                totalPageBeforeText : '共',
                totalPageAfterText : '页',
                totalRecordsAfterText : '条数据',
                gopageBeforeText : '转到',
                gopageButtonOkText : '确定',
                gopageAfterText : '页',
                buttonTipBeforeText : '第',
                buttonTipAfterText : '页'
            }
        });
        //生成
        kkpager.generPageHtml();
    });
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
</html>
